extern crate docopt;
#[phase(plugin)] extern crate docopt_macros;
-use std::os;
-
use cargo::ops;
use cargo::{execute_main_without_stdin};
use cargo::core::{MultiShell};
use cargo::util::{CliResult, CliError};
-use cargo::util::important_paths::find_project_manifest;
+use cargo::util::important_paths::{find_root_manifest_for_cwd};
docopt!(Options, "
Build a package's documentation
fn execute(options: Options, shell: &mut MultiShell) -> CliResult<Option<()>> {
shell.set_verbose(options.flag_verbose);
- let root = match options.flag_manifest_path {
- Some(path) => Path::new(path),
- None => try!(find_project_manifest(&os::getcwd(), "Cargo.toml")
- .map_err(|_| {
- CliError::new("Could not find Cargo.toml in this \
- directory or any parent directory",
- 102)
- }))
- };
+
+ let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path));
let mut doc_opts = ops::DocOptions {
all: !options.flag_no_deps,